#pragma once
//#include "stdafx.h"
#include "patch.h"

namespace LPS
{
	using namespace org::spark::core;
	using namespace org::spark::data;
	using namespace org::spark::space;
	//using namespace org::spark::utils;
	using namespace org::spark::math;

	void patch::_init()
	{
	}

	patch::patch() : SpaceAgent(0.5, SpaceAgent.SQUARE)
	{
		_init();
	}

	void patch::causeDamage()
	{
		double b = 0;
		double a = 0;

		a = 1.0;
		b = 1.0;
		if ((LPSmodel::pro->getValue(this) > LPSmodel::proDamThresh))
		{
			if ((0.1 > RandomHelper::random(1.0)))
			{
				LPSmodel::damage->addValue(this, ((LPSmodel::maxProDam * exp((a + (b * LPSmodel::pro->getValue(this))))) / (1.0 + exp((a + (b * LPSmodel::pro->getValue(this)))))));
				LPSmodel::proDam = LPSmodel::damage->getValue(this);
			}
		}
	}
}
